import React, { Component } from 'react';
import BlockColor from './BlockColor'


/**
 * 
 */
export default class AppContainer extends Component {
    constructor(props) {
        super(props);
        this.state = {
            index: 0
        }
        this.colorChange = this.colorChange.bind(this);
    }
    colorChange(val) {
        window.less.modifyVars(
            {
                '@primary-color': val,
                '@link-color': val,
                '@btn-primary-bg': val,
            }
        )
    }

    render() {
        return (
            <BlockColor
                list={[
                    {
                        key: '#f5222d',
                        title: '薄暮',
                    },
                    {
                        key: '#fa541c',
                        title: '火山',
                    },
                    {
                        key: '#faad14',
                        title: '日暮',
                    },
                    {
                        key: '#13c2c2',
                        title: '明青',
                    },
                    {
                        key: '#52c412',
                        title: '极光青',
                    },
                    {
                        key: '#1890ff',
                        title: '拂晓蓝（默认）',
                    },
                    {
                        key: '#2f54eb',
                        title: '极客蓝',
                    },
                    {
                        key: '#722ed1',
                        title: '酱紫',
                    },
                ]}
                onChange={this.colorChange}
            />
        )
    }
}



